1. Field
The present disclosure pertains to the field of data processing apparatuses and, more specifically, to the field of floating point arithmetic in data processing apparatuses.
2. Description of Related Art
A single instruction, the fused multiply-add instruction, has been used to support the four basic floating point arithmetic operations of addition, subtraction, and multiplication. Generally, this instruction takes three floating point inputs, A, B, and C, and returns A*B+C. To perform the operation of X+Y, A can be set to one, B can be set to X, and C can be set to Y. To perform the operation of X−Y, A can be set to one, B can be set to X, and C can be set to negative Y. To perform X*Y, A and B can be set to X and Y, respectively, and C can be set to zero.
Additionally, the fused multiply-add instruction takes advantage of the structure of a typical basic multiplier to perform a multiply-add operation, often used in graphics processing, with one instruction instead of two, without significantly increasing the latency of the typical basic multiplier. Specifically, the typical basic multiplier includes summation logic to add the partial products of the multiplication of A and B, so C can be simply treated as one additional partial product.